package com.instagram.instadownloader.utils.sharepreferences;

/**
 * provider functions getter / setter settings application on share preferences.
 * 
 * @author TND
 * Oct 24, 2013
 */
public class SharePreferencesUtil extends BasePreferences {

    protected static final String ESSILOR_SETTINGS = "instadownloader";
    protected static final int PRIVATE_MODE = 0;

    /**
     * @param pPreferencesName
     * @param pPreferencesMode
     */
    public SharePreferencesUtil(String pPreferencesName, int pPreferencesMode) {
        super(ESSILOR_SETTINGS, PRIVATE_MODE);
    }

    public static int getIntValue(String pModeName, int pDefaultValue) {
        return getValueFromPreferences(pModeName, pDefaultValue);
    }

    public static void setIntValue(String pModeName, int pMode) {
        saveValueToSharedPreferences(pModeName, pMode);
    }

    public static String getStringValue(String pKeyName, String pDefaultValue) {
        return getValueFromPreferences(pKeyName, pDefaultValue);
    }

    public static void setStringValue(String pKeyName, String pValue) {
        saveValueToSharedPreferences(pKeyName, pValue);
    }

    public static void setBooleanValue(final String pKeyName, final boolean pValue) {
        saveValueToSharedPreferences(pKeyName, pValue);
    }

    public static boolean getBooleanValue(final String pKeyName, final boolean pDefaultValue) {
        return getValueFromPreferences(pKeyName, pDefaultValue);
    }
}
